import request from './request.js'
/**
 * @param { url } 接口地址
 * @param { method } 请求方式
 * @param { data } 请求参数
 * 
 */

export const vsCode = {
  imgCode(options) {
    const token = uni.getStorageSync('token') ||''
    return new Promise((resolve, reject) => {
      let requestData = {};
      if (options.data) {
        requestData = Object.assign({}, requestData, options.data);
      }
			request({
        url: options.url,
        method: options.method || "GET",
        data: requestData,
        responseType: "arraybuffer",
        header: {
          'nf-captcha-id':options.random||token,//token
        },
			}).then(res => {
				resolve(res)
			})
    });
  }
};


 